﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExamPaper.aspx.cs" Inherits="OA.Exam.Front.ExamPaper" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>在线考试</title>
    <link href="../../Themes/Default/Style.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript">
        document.onkeydown = function() {
            if ((window.event.keyCode == 116) || //屏蔽 F5
                (window.event.keyCode == 122) || //屏蔽 F11
                (window.event.shiftKey && window.event.keyCode == 121)) {//shift+F10
                window.event.keyCode = 0;
                window.event.returnValue = false;
            }
            if ((window.event.altKey) && (window.event.keyCode == 115)) { //屏蔽Alt+F4
                window.showModelessDialog("about:blank", "", "dialogWidth:1px;dialogheight:1px");
                return false;
            }
        }
        if (window.Event)
            document.captureEvents(Event.MOUSEUP);
        function nocontextmenu() {
            event.cancelBubble = true;
            event.returnValue = false;
            return false;
        }
        function norightclick(e) {
            if (window.Event) {
                if (e.which == 2 || e.which == 3)
                    return false;
            }
            else
                if (event.button == 2 || event.button == 3) {
                event.cancelBubble = true;
                event.returnValue = false;
                return false;
            }
        }
        document.oncontextmenu = nocontextmenu; // for IE5+
        document.onmousedown = norightclick; // for all others
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
    </asp:Timer>
    <div>
        <table width="98%">
            <tr>
                <td colspan="2" class="TitleZone" style="text-align: center">
                    <asp:Label ID="LabPaperName" runat="server" Text="Label"></asp:Label>
                    <input id="HiddenPaperId" type="hidden" runat="server" />
                    <input id="HiddenExamTime" type="hidden" runat="server" />
                    <asp:Label ID="LabPrompt" runat="server" Text="" ForeColor="Red"></asp:Label>
                    <input id="HiddenBeginTime" type="hidden" runat="server" />
                    <input id="HiddenStatus" type="hidden" runat="server" />
                    <input id="HiddenBlankNum" type="hidden" runat="server" />
                </td>
            </tr>
            <tr>
                <td style="width: 75%">
                </td>
                <td style="width: 25%">
                    总分：<asp:Label ID="LabScore" runat="server" Text="Label"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="width: 75%">
                </td>
                <td style="width: 25%">
                    时长：<asp:Label ID="LabExamTime" runat="server" Text="Label"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="width: 75%">
                </td>
                <td style="width: 25%">
                    考生：<asp:Label ID="LabUserName" runat="server" Text="Label"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="width: 75%">
                </td>
                <td style="width: 25%">
                    剩余时间：
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:Label ID="LabTimeLeft" runat="server" Text="Label"></asp:Label>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                        </Triggers>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <hr />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:DataList ID="DataListBigQuestion" runat="server" Width="98%" DataKeyField="ItemType"
                        OnItemDataBound="DataListBigQuestion_ItemDataBound">
                        <ItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td colspan="2">
                                        <asp:Label ID="LabNumMark" runat="server" Text='<%# Container.ItemIndex+1 %>' Visible="false"></asp:Label>
                                        <asp:Label ID="LabNum" runat="server" Text='<%# Container.ItemIndex+1 %>'></asp:Label>、
                                        <asp:Label ID="LabItemType" runat="server" Text='<%#Eval("TypeName") %>'></asp:Label>
                                        <asp:Label ID="LabDescription" runat="server" Text="Label"></asp:Label>
                                        <asp:Label ID="LabScore" runat="server" Text='<%#"每题"+Eval("score")+"分）" %>'></asp:Label>
                                        <asp:HiddenField ID="HfScore" runat="server" Value='<%#Eval("score") %>' />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 5%">
                                    </td>
                                    <td style="width: 95%">
                                        <asp:DataList ID="DataListQuestions" runat="server" Width="100%" DataKeyField="QuestionId"
                                            OnItemDataBound="DataListQuestions_ItemDataBound">
                                            <ItemTemplate>
                                                <table width="100%">
                                                    <tr>
                                                        <td style="width: 80%">
                                                            <asp:HiddenField ID="HfQuestionId" runat="server" Value='<%#Eval("QuestionId") %>' />
                                                            <asp:HiddenField ID="HfItemType" runat="server" Value='<%#Eval("ItemType") %>' />
                                                            <asp:Label ID="LabQNum" Text='<%#Container.ItemIndex+1 %>' runat="server"></asp:Label>.
                                                            <asp:Label ID="LabSubject" runat="server" Text='<%# Eval("Subject") %>'></asp:Label>
                                                            <asp:Label ID="LabSubjectiveScore" runat="server" Text='<%#"（本题分值："+Eval("EachScore")+"分）" %>'
                                                                Visible='<%#Eval("ItemType").ToString()=="00004"||Eval("ItemType").ToString()=="00005"?true:false %>'></asp:Label>
                                                        </td>
                                                        <td style="width: 20%">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td colspan="2">
                                                            <div id="DivJudge" runat="server" visible='<%#Eval("ItemType").ToString()=="00001"?true:false %>'>
                                                                <asp:RadioButtonList ID="RabJudge" runat="server" RepeatDirection="Horizontal">
                                                                    <asp:ListItem Value="1">正确</asp:ListItem>
                                                                    <asp:ListItem Value="0">错误</asp:ListItem>
                                                                </asp:RadioButtonList>
                                                            </div>
                                                            <div id="DivRadio" runat="server" visible='<%#Eval("ItemType").ToString()=="00002"?true:false %>'>
                                                                <asp:DataList ID="DataListRadio" runat="server">
                                                                    <ItemTemplate>
                                                                        <asp:RadioButton ID="RabItem" runat="server" />&nbsp;
                                                                        <asp:Label ID="LabRadioItem" runat="server" Text='<%# Eval("ItemNum") %>'></asp:Label>.
                                                                        <asp:Label ID="LabRadioItemContent" runat="server" Text='<%# Eval("ItemContent") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:DataList>
                                                            </div>
                                                            <div id="DivMultiple" runat="server" visible='<%#Eval("ItemType").ToString()=="00003"?true:false %>'>
                                                                <asp:DataList ID="DataListMultiple" runat="server">
                                                                    <ItemTemplate>
                                                                        <asp:CheckBox ID="ChbItem" runat="server" />&nbsp;
                                                                        <asp:Label ID="LabMultipleItem" runat="server" Text='<%# Eval("ItemNum") %>'></asp:Label>.
                                                                        <asp:Label ID="LabMultipleItemContent" runat="server" Text='<%# Eval("ItemContent") %>'></asp:Label>
                                                                    </ItemTemplate>
                                                                </asp:DataList>
                                                            </div>
                                                            <asp:Panel ID="PanelBlank" runat="server" Visible='<%#Eval("ItemType").ToString()=="00004"?true:false %>'>
                                                                <asp:TextBox ID="BlankTextBox1" runat="server" Visible="false"></asp:TextBox>
                                                                <asp:TextBox ID="BlankTextBox2" runat="server" Visible="false"></asp:TextBox>
                                                                <asp:TextBox ID="BlankTextBox3" runat="server" Visible="false"></asp:TextBox>
                                                                <asp:TextBox ID="BlankTextBox4" runat="server" Visible="false"></asp:TextBox>
                                                                <asp:TextBox ID="BlankTextBox5" runat="server" Visible="false"></asp:TextBox>
                                                                <asp:TextBox ID="BlankTextBox6" runat="server" Visible="false"></asp:TextBox>
                                                            </asp:Panel>
                                                            <div id="DivSimple" runat="server" visible='<%#Eval("ItemType").ToString()=="00005"?true:false %>'>
                                                                <asp:TextBox ID="TxtAnswer" runat="server" CssClass="inputText" TextMode="MultiLine"
                                                                    Width="700px" Height="150px"></asp:TextBox>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </asp:DataList>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:DataList>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="BtnSave" runat="server" Text="保存" CssClass="closebtn" OnClick="BtnSave_Click" />
                    <asp:Button ID="BtnLogin" runat="server" Text="提交" CssClass="closebtn" OnClick="BtnLogin_Click"
                        OnClientClick=" return confirm('请仔细检查是否已完成所有问题。确定要提交试卷吗？')" />
                    <input id="BtnClose" type="button" value="关闭" class="closebtn" onclick="window.close()" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
